package com.ruoyi.goods.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 出入库单据对象 stock_bill
 *
 * @author lanmao
 * @date 2022-11-28
 */
@TableName("stock_bill")
@Getter
@Setter
public class StockBill extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 单据流水号
     */
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private String id;

    /**
     * 类型
     */
    @Excel(name = "类型")
    @TableField("type")
    private Integer type;

    /**
     * 仓库
     */
    @Excel(name = "仓库")
    @TableField("store_id")
    private String storeId;

    /**
     * 出入库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出入库时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("busi_date")
    private Date busiDate;

    /**
     * 状态
     */
    @Excel(name = "状态")
    @TableField("status")
    private Integer status;

    /**
     * 录入时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "录入时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("operate_date")
    private Date operateDate;

    /**
     * 录入人
     */
    @Excel(name = "录入人")
    @TableField("operator_id")
    private Long operatorId;

    /* 录入人姓名 */
    @TableField(exist = false)
    private String operatorName;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("type", getType())
                .append("storeId", getStoreId())
                .append("busiDate", getBusiDate())
                .append("status", getStatus())
                .append("operateDate", getOperateDate())
                .append("operatorId", getOperatorId())
                .append("remark", getRemark())
                .toString();
    }
}
